package com.zzf.concurrent.example.design.pattern.single.thread;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @author GaoFeng2017
 * @date 2019/9/6 15:32
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Slf4j
public class User extends Thread{

    private String username;
    private String idCard;
    private String ticket;
    private Gate gate;

    @Override
    public void run() {
        log.info("Thread {} is begin.", this.username);
        while(true) {
            gate.pass(this.idCard, this.ticket);
        }
    }
}
